package com.example.demo.exception;

import com.example.demo.enums.StatusCodeEnum;
import lombok.Data;

/**
 * @description：自定义异常.
 * @author：lw
 * @since：2023/12/29
 **/
@Data
public class CustomException extends  RuntimeException{
    private Integer code ;
    private String message ;


    public CustomException(StatusCodeEnum statusCodeEnum){
        this.code=statusCodeEnum.getCode();
        this.message=statusCodeEnum.getMessage();
    }

    public CustomException(Integer code,String message){
        this.code=code;
        this.message=message;
    }

}
